<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Dashboard - Apache Flink</title>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.css" rel="stylesheet">

    <!-- Add custom CSS here -->
    <link href="css/sb-admin.css" rel="stylesheet">
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="css/nephelefrontend.css" />
    
    <!-- Scripts from Bootstrap -->
    <script src="js/jquery-2.1.0.js"></script>
    <script src="js/bootstrap.js"></script>
    
    <!-- Scripts from Flink -->
	<script type="text/javascript" src="js/helpers.js"></script>
	<script type="text/javascript" src="js/jobmanagerFrontend.js"></script>
	<script type="text/javascript" src="js/jcanvas.min.js"></script>
	
	<!-- Insert Version -->
 	<script type="text/javascript">
	$(document).ready(function() {
		$.ajax({ url : "jobsInfo?get=version", type : "GET", cache: false, success : function(json) {
			$("#version").empty();
			if (json.version.indexOf("SNAPSHOT") > -1) {
				$("#version").append(" " + json.version + " - " + json.revision);
			} else {
				$("#version").append(" " + json.version);
			}
		}, dataType : "json",
		});
	});
  	</script>
  	
  	<!-- Load Menu -->
	<script type="text/javascript">
	$(document).ready(function() {
		$.ajax({ url : "menu?get=index", type : "GET", cache: false, success : function(html) {
			$("#side-menu").empty();
			$("#side-menu").append(html);
		}, dataType : "html",
		});
	});
  	</script>
  </head>

  <body>

    <div id="wrapper">
	  
      <!-- Sidebar -->
	  <nav class='navbar navbar-inverse navbar-fixed-top' role='navigation'>
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <table>
            <tr>
              <td><img src="img/flink-logo.png" alt="Flink Logo" style="margin-left:15px; margin-top:5px; width:40px;height:40px";></td>
              <td style="vertical-align:top"><a class="navbar-brand" href="index.html">Apache Flink</a></td>
            </tr>
          </table>
        </div>
	 
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse navbar-ex1-collapse">
          <ul id="side-menu" class="nav navbar-nav side-nav"> 
          <!-- Filled via script -->
          </ul>
          <ul class="nav navbar-nav navbar-right navbar-user">
            <li class="dropdown user-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-archive"></i> Log Files<b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="logInfo"><i class="fa fa-keyboard-o"></i> Log Info</a></li>
                <li><a href="logInfo?get=stdout"><i class="fa fa-keyboard-o"></i> Stdout</a></li>
              </ul>
            </li>
          </ul>
        </div><!-- /.navbar-collapse -->
      </nav>

      <div id="page-wrapper">

        <div class="row">
          <div class="col-lg-12">
            <h1>Apache Flink Dashboard<small id="version"></small></h1>
            <ol class="breadcrumb">
              <li class="active"><i class="fa fa-dashboard"></i> Dashboard</li>
            </ol>
          </div>
        </div><!-- /.row -->

        <div class="row">
          <div class="col-lg-2">
            <div class="panel panel-info">
              <div class="panel-heading">
                <div class="row">
                  <div class="col-xs-4">
                    <i class="fa fa-info fa-5x"></i>
                  </div>
                  <div class="col-xs-8 text-right">
                    <p class="announcement-heading"><span id="stat-taskmanagers" class="stats"></span></p>
                    <p class="announcement-text">Task Manager</p>
                  </div>
                </div>
              </div>
            </div>
          </div>
           <div class="col-lg-2">
            <div class="panel panel-primary">
              <div class="panel-heading">
                <div class="row">
                  <div class="col-xs-4">
                    <i class="fa fa-list-ol fa-5x"></i>
                  </div>
                  <div class="col-xs-8 text-right">
                    <p class="announcement-heading"><span id="stat-slots" class="stats"></span></p>
                    <p class="announcement-text">Processing Slots</p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="col-lg-2">
            <div class="panel panel-success">
              <div class="panel-heading">
                <div class="row">
                  <div class="col-xs-4">
                    <i class="fa fa-check fa-5x"></i>
                  </div>
                  <div class="col-xs-8 text-right">
                    <p class="announcement-heading"><span id="jobs-finished" class="stats"></span></p>
                    <p class="announcement-text">Jobs Finished</p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="col-lg-2">
            <div class="panel panel-warning">
              <div class="panel-heading">
                <div class="row">
                  <div class="col-xs-4">
                    <i class="fa fa-eraser fa-5x"></i>
                  </div>
                  <div class="col-xs-8 text-right">
                    <p class="announcement-heading"><span id="jobs-canceled" class="stats"></span></p>
                    <p class="announcement-text">Jobs Canceled</p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="col-lg-2">
            <div class="panel panel-danger">
              <div class="panel-heading">
                <div class="row">
                  <div class="col-xs-4">
                    <i class="fa fa-flash fa-5x"></i>
                  </div>
                  <div class="col-xs-8 text-right">
                    <p class="announcement-heading"><span id="jobs-failed" class="stats"></span></p>
                    <p class="announcement-text">Jobs Failed</p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="col-lg-2">
            <!-- empty -->
          </div>
        </div><!-- /.row -->

        <div class="row">
          <div class="col-lg-12">
            <div class="panel panel-primary">
              <div class="panel-heading">
                <h3 class="panel-title"><i class="fa fa-play"></i> Running Jobs</h3>
              </div>
              <div class="panel-body">
                <p id="rJpH">There are currently no running jobs, but you can analyze your old jobs in the history.<p>
                <div id="jobs" class="contentbox-wrapper"></div>
              </div>
            </div>
          </div>
        </div><!-- /.row -->

      </div><!-- /#page-wrapper -->

    </div><!-- /#wrapper -->
  </body>
  
</html>
